#!/usr/bin/perl

use strict;
use warnings;

#my @all_interv=(
#		[1,100],
#		[100000,199999],
#		[200000,299999],
#		[300000,399999],
#		[400000,499999],
#		[500000,599999],
#		[600000,699999],
#		[700000,799999],
#		[800000,899999],
#		[900000,999999],
#		[1,4999999],
#		[5000000,9999999],
#		[10000000,14999999],
#		[15000000,19999999],
#		[20000000,24999999],
#		[25000000,29999999],
#		[30000000,34999999],
#		[35000000,39999999],
#		[40000000,44999999],
#		[45000000,49999999],
#		[50000000,54999999],
#		[55000000,59999999],
#		[60000000,64999999],
#		[65000000,69999999],
#		[70000000,74999999],
#		[75000000,79999999],
#		[80000000,84999999],
#		[85000000,89999999],
#		[90000000,94999999],
#		[95000000,99999999]
#);

my @all_interv=([0,100000]);

for (1..99999999){
	if ($_%100000==0){
#		print "$_,".($_+100000)."\n";
		push(@all_interv,[$_,$_+100000]);
	}
}

for my $interv(@all_interv){
	my $min=$interv->[0];
	my $max=$interv->[1];
	my $cnt=0;
	open FILE,"reteaua_bilete_s12.txt";
	while(<FILE>){
		chomp $_;
		if ($_>$max){
			last;
		}
		if ($_>=$min){
			$cnt++;
		}
	}
	close FILE;

	print "$cnt $min $max\n";
}

